﻿CREATE PROCEDURE [dbo].[yaf_message_findunread](
                @TopicID  INT,
                @LastRead DATETIME)
AS
    BEGIN
        SELECT   TOP 1 MessageID
        FROM     yaf_Message
        WHERE    TopicID = @TopicID
        AND Posted > @LastRead
        ORDER BY Posted
    END


